package com.peas.platform.module.icims.base.mdm.adapter.repository.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.peas.platform.common.core.annotation.Comment;
import com.peas.platform.framework.mybatisplus.po.BasePo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import javax.validation.constraints.*;

// 文件
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`tbl_file`")
public class FilePo extends BasePo {

    // 附件ID
    // （附件表）外键
    @Comment(value = "附件ID")
    @TableField(value = "`attachment_id`", jdbcType = JdbcType.BIGINT)
    private Long attachmentId;

    // 附件类型
    // 1:文件夹、2:文件
    // 枚举取值:AttachmentType
    @Comment(value = "附件类型", enumType = "AttachmentType")
    @Size(max = 20, message = "附件类型不能超过20个字符")
    @TableField(value = "`attachment_type`", jdbcType = JdbcType.VARCHAR)
    private String attachmentType;

    // 文件类型
    // 字典取值:FileType
    @Comment(value = "文件类型", dictType = "FileType")
    @Size(max = 20, message = "文件类型不能超过20个字符")
    @TableField(value = "`file_type`", jdbcType = JdbcType.VARCHAR)
    private String fileType;

    // 文件名
    @Comment(value = "文件名")
    @Size(max = 200, message = "文件名不能超过200个字符")
    @TableField(value = "`file_name`", jdbcType = JdbcType.VARCHAR)
    private String fileName;

    // 文件大小(字节)
    @Comment(value = "文件大小(字节)")
    @TableField(value = "`file_size`", jdbcType = JdbcType.BIGINT)
    private Long fileSize;

    // 附件下载次数
    @Comment(value = "附件下载次数")
    @TableField(value = "`downloads`", jdbcType = JdbcType.INTEGER)
    private Integer downloads;

    // 附件引用次数
    @Comment(value = "附件引用次数")
    @TableField(value = "`references`", jdbcType = JdbcType.INTEGER)
    private Integer references;

    // 附件上传人用户ID
    // （用户表）外键
    @Comment(value = "附件上传人用户ID")
    @TableField(value = "`uploader`", jdbcType = JdbcType.BIGINT)
    private Long uploader;

    // 附件上传人姓名
    @Comment(value = "附件上传人姓名")
    @Size(max = 20, message = "附件上传人姓名不能超过20个字符")
    @TableField(value = "`uploader_name`", jdbcType = JdbcType.VARCHAR)
    private String uploaderName;

    // 适用模块
    // 枚举取值:Module
    @Comment(value = "适用模块", enumType = "Module")
    @Size(max = 20, message = "适用模块不能超过20个字符")
    @TableField(value = "`module`", jdbcType = JdbcType.VARCHAR)
    private String module;

    // 上级附件ID
    // （附件表）外键
    @Comment(value = "上级附件ID")
    @TableField(value = "`parent_id`", jdbcType = JdbcType.BIGINT)
    private Long parentId;

}
